<?php
use yii\helpers\Html;
use kartik\form\ActiveForm;
use kartik\file\FileInput;
use yii\helpers\Url;

$this->title = Yii::t('app', 'Change Password');
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="row profile">
    <?php $form = ActiveForm::begin(); ?>
    <div class="col-md-12">
        <?php if($changed===false){ ?>
        <div class="flex flex-end align-center">
            <?= Html::submitButton('<i class="fa fa-save"> </i> '.Yii::t('app', 'Save'), ['class' =>  'btn btn-save btn-primary']) ?>
        </div>
        <div class="space10"></div>
        <?php } ?>

        <div class="box box-primary">
            <div class="box-header">
                <h3>Password</h3>
                <hr>
            </div>
            <div class="box-body page-section singleUpload">

                <?php if($changed===true){ ?>
                <div class="callout callout-success">
                    <h4>Password changed successful!</h4>
                </div>
                <?php } else { ?>
                    <?= $form->field($model, 'password')->passwordInput()->label(Yii::t('app','Password')) ?>
                    <?= $form->field($model, 'newPassword')->passwordInput()->label(Yii::t('app','New Password')) ?>
                    <?= $form->field($model, 'confirmPassword')->passwordInput()->label(Yii::t('app','Confirm Password')) ?>
                <?php } ?>


            </div>
        </div>
    </div>

    <?php ActiveForm::end(); ?>
</div>

<script src="../js/jquery-2.2.3.min.js?v=1.0"></script>
<script>
    $('.btn-save').on('click',function () {
        console.log('on click')
        ymz.jq_loading.show({text:"<?=Yii::t('app','Loading').'...'?>", is_cover: 1});
    })
</script>

